﻿#include "guild_welfare_logic.h"
#include <vector>

#include "GuildRepoCell_struct.h"
#include "GuildAuctionRole_struct.h"
#include "GuildAuctionRoleInfo_struct.h"
#include "GuildAuctionAttentionInfo_struct.h"
#include "GuildAuctionItem_struct.h"
#include "GuildModuleRepository_struct.h"

#include "error/make_error_code.h"
#include "guild/guild_loader.hpp"
#include "guild/module/guild_module_loader.hpp"

#include "GuildRepositoryCellRoleView_struct.h"
#include "GuildRepositoryAuctionRoleView_struct.h"
#include "GuildRepositoryAuctionItemRoleView_struct.h"
#include "GetGuildRepositoryRoleViewRes_struct.h"


namespace guild_service {

// bool guildservicewelfareLogic::GetModuleRepository(
//     const guild_id_type guild_id, GuildModuleRepository &module_repository) {
//   return detail::GetGuildModule<GuildModuleRepository>(
//       kGuildServiceQueryName, guild_id, kGuildModuleRepositoryName,
//       module_repository);
// }

bool guildservicewelfareLogic::GetGuildRepositoryRoleView(const role_uuid_type role_uuid,
                              /*GetGuildRepositoryRoleViewRes &role_view,*/ error_code &ec) {
  if (role_uuid == kInvalidRoleUuid) {
    ec = ErrorCode::ERR_INVALID_ROLE_UUID;
    return false;
  }

  // guild_id_type guild_id = kInvalidGuildId;
  // if (!detail::LoadGuildIdByRole(kGuildServiceQueryName, role_uuid, guild_id)) {
  //   ec = ErrorCode::ERR_GUILD_NOT_EXIST;
  //   return false;
  // }

  // GuildModuleRepository module_repository;
  // if (!guildservicewelfareLogic::GetModuleRepository(guild_id, module_repository)) {
  //   ec = ErrorCode::ERR_GUILD_MOD_REPOSITORY_LOAD_FAILED;
  //   return false;
  // }

  // TODO role_view.cell_capacity = 0;
  // TODO role_view.cell_view
  // TODO role_view.auction_view
  // TODO role_view.next_auction_timestamp = 0;

  return true;
}
 
}  // namespace guild_service